package com.moli.iov.manager.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.moli.iov.manager.mapper.AuthorityRoleAuthMapper;
import com.moli.iov.manager.model.po.AuthorityAuth;
import com.moli.iov.manager.model.po.AuthorityRoleAuth;
import com.moli.iov.manager.service.IAuthorityRoleAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 角色菜单中间表 服务实现类
 * </p>
 *
 * @author fudaohui
 * @since 2018-12-12
 */
@Service
public class AuthorityRoleAuthServiceImpl extends ServiceImpl<AuthorityRoleAuthMapper, AuthorityRoleAuth> implements IAuthorityRoleAuthService {


    @Autowired
    private AuthorityRoleAuthMapper authorityRoleAuthMapper;

    @Override
    @Transactional(rollbackFor = {Exception.class})
    public boolean saveOrUpdateAuthorityRoleAuths(List<AuthorityRoleAuth> authorityRoleAuths) {
        return saveOrUpdateBatch(authorityRoleAuths, 1);
    }

    @Override
    public List<Long> queryAuthIdsByRoleId(long roleId,int selectStatus) {
        return authorityRoleAuthMapper.queryAuthIdsByRoled(roleId,selectStatus);
    }

    @Override
    public int deleteAuthorityRoleBatchByroleds(Long roleId) {

        return authorityRoleAuthMapper.deleteAuthorityRoleBatchByroleds(roleId);
    }



}
